package com.mfhcd.facepay.adapter;

import android.content.Context;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mfhcd.facepay.R;
import com.mfhcd.facepay.model.TypeModel;

import java.util.List;

/**
 * @author zhanghs
 * @date 2016-12-7
 */

public class GridKeyboardAdapter extends BaseQuickAdapter<TypeModel, BaseViewHolder> {

    private List<TypeModel> mDataList;
    private Context mContext;
    private int gridWidth, gridHeight;

    public GridKeyboardAdapter(Context context, @Nullable List<TypeModel> data) {
        super(R.layout.layout_keyboard_item, data);
        this.mContext = context;
        this.mDataList = mDataList;
    }

    @Override
    protected void convert(BaseViewHolder helper, TypeModel item) {
//        helper.getView(R.id.grid_view).setLayoutParams(new LinearLayout.LayoutParams(gridWidth / 3, gridHeight / 4));
        helper.setText(R.id.griditem_title, item.getDkey());
    }

    public void setLayoutWidthHeight(int width, int height) {
        this.gridWidth = width;
        this.gridHeight = height;
    }
}
